import ESM from "../src/index.js";
import testTree from "https://cdn.jsdelivr.net/npm/jest-test-tree@1/dist/jest-test-tree.browser.js";
window.ESM = ESM;
const {
    core: { describe, it, expect, run },
} = window.jestLite;
testTree({
    install解析: [
        [
            "lodash加载",
            () => ESM.install("lodash", { type: "script" }),
            () => expect(window._).toBeTruthy(),
        ],
        [
            "request 加载",
            () => ESM.install("@konghayao/request", { type: "module" }),
            (res) => expect(res.default).toBeTruthy(),
        ],
    ],
    search校验: [
        ["search 普通操作", () => ESM.search("@konghayao")],
        ["listVersion 普通操作", () => ESM.listVersion("@konghayao/request")],
        ["listDir 普通操作", () => ESM.ls("@konghayao/request/")],
    ],
});
jestLite.prettify.toHTML(run(), document.body);
